Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[onert-micro] Resolve svace warning #13557

Closed
wants to merge 1 commit into from

Conversation

ljwoo94
Copy link
Contributor

@ljwoo94 ljwoo94 commented Jul 29, 2024

This commit resolves warnings from static analysis reported by svace.

Signed-off-by: Jungwoo Lee [email protected]

This commit resolves warnings from static analysis reported by svace.
Signed-off-by: Jungwoo Lee <[email protected]>
@ljwoo94 ljwoo94 requested a review from chunseoklee July 29, 2024 12:32
@@ -42,7 +42,7 @@ void configure_kernel_CircleExpandDims(const circle::Operator *cur_op,
auto axis_data = runtime_graph->getConstDataByTensor(axis);
assert(axis_data != nullptr);

int32_t axis_value;
int32_t axis_value = -1;
Copy link
Contributor Author

@ljwoo94 ljwoo94 Jul 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uninitialized data is read from local variable 'axis_value' at ExpandDims.cpp:59.

@@ -417,6 +417,7 @@ uint8_t *RuntimeGraph::getConstDataByTensor(const circle::Tensor *raw_tensor)
#endif // ENABLE_TRAINING

auto const &buffer = wrap(_reader->buffers()[raw_tensor->buffer()]->data());
assert(buffer.data() != nullptr);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a function 'luci_interpreter::RuntimeGraph::getConstDataByTensor' is dereferenced at While.cpp:110 without checking for null

@@ -69,6 +69,7 @@ void UnpackImpl(const circle::Operator *cur_op, const circle::Tensor *input, int
const auto t = runtime_graph->getCircleTensorByIndex(output_index);
assert(output0 != nullptr);
T *output_data = kernels::getTensorData<T>(runtime_graph->getDataByTensor(t));
assert(output_data != nullptr);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

luci_interpreter::kernels::getTensorData' is dereferenced at Unpack.cpp:78 without checking for null

@ljwoo94
Copy link
Contributor Author

ljwoo94 commented Jul 29, 2024

Need to be changed to if~else or throw since assert is only for debug mode.

@ljwoo94
Copy link
Contributor Author

ljwoo94 commented Jul 31, 2024

luci-interpreter might be deprecated.

@ljwoo94 ljwoo94 closed this Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant